<%-- 
    Document   : TCubeAccountRegistrationStatus
    Created on : Sep 27, 2011, 4:07:01 PM
    Author     : Belinda
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList, BusinessLogic.Constants"%>

<!DOCTYPE html>
<html>
    <!-- InstanceBegin template="../TransactWeb/Templates/FdSageAdmin.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <!-- InstanceBeginEditable name="doctitle" -->
        <title>FoodSage - Account Registration Status</title>
        <script language="javascript" type="text/javascript" src="../TransactWeb/js/jquery-1.6.4.min.js"></script>
        <script language="javascript" type="text/javascript" src="../TransactWeb/js/jquery.form.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/fieldsetCollapse.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/tcubmenu.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/accordion.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/scroller.js"></script>
        <script type="text/javascript" src="../TransactWeb/js/Utilities.js"></script>

        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/gridsys.css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/reset1.css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/tcube.css" />
        <link href="../TransactWeb/css/gridsys.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="../TransactWeb/css/tcubaccd.css" />
        <script type="text/javascript">
            // Check Session to show relevant menus
            // Be sure to import Utilities.js in the script file	and declare partnerMenu as a servelet element
            window.onload = showPage('tcubeMenu', 'leftnav');

            // If not logged in, use : 
            //window.onload = showPage('topMenutcube', 'topmenu');
            //IF logged in use : 
            window.onload = showPage('topMenulogouttcube', 'topmenu');

            //welcome msg
            window.onload = showPage('welcomeMenutcube','welcome');

            //footer
            window.onload = showPage('tcubeFooter','footer');
        </script>
    </head>

    <body>
        <div class="container_12">
            <!-- Header Nav -->
            <div class="grid_3"><img src="../TransactWeb/img/reservation/foodsglogo.png" width="146" height="178" /></div>
            <div class="grid_9 nav">
                <div id="topmenu"></div>
            </div>

            <div class="grid_12">
                <hr size="3" color="#CC6600" />
            </div>

            <!-- Welcome Message -->
            <div class="grid_12 welcome">

                <div id="welcome"></div>
            </div>
            <!-- End Welcome Message-->

            <!-- End of Header Nav -->
            <!-- Menu / Planner -->
            <div class="grid_4">
                <div id="leftnav"></div>
            </div>

            <!--End Menu/ Planner -->
            <!-- Content -->
            <div class="grid_8 content">
                <!-- Content Header -->
                <%
                    ArrayList data = (ArrayList) request.getAttribute("data");
                    int result = ((Integer) data.get(0)).intValue();
                    if (result == Constants.STATUS_SUCCESSFUL) {
                %>
                <table width="600" border="0" style="padding:10px 0px 10px 0px;">
                    <tr>
                        <td>
                            You have successfully created an account for TCube employee.<br/>
                            If you're not redirected to Homepage in 10s, please click <a href="http://localhost:8080/portal/internal/TCubeHome">here</a>.
                        </td>
                    </tr>
                </table>

                <script type="text/javascript">
                    $(document).ready(function() {
                        setTimeout(window.location.replace("http://localhost:8080/portal/internal/TCubeHome"), 4000);
                    });
                </script>

                <%} else if (result == Constants.STATUS_NOT_UNIQUE) {
                %>
                <table width="600" border="0" style="padding:10px 0px 10px 0px;">
                    <tr>
                        <td>
                            An employee with this IC number, Username or Email has already registered with us.<br/>
                            Please check the information you typed again!<br/>
                            If you're not redirected to TCube Account Registration page in 6s, please click <a href="javascript: history.back()">here</a>.
                        </td>
                    </tr>
                </table>
                <script type="text/javascript">
                    $(document).ready(function() {
                        setTimeout(history.back(), 6000);
                    });
                </script>

                <%        } else if (result == Constants.STATUS_SESSION_EXPIRED) {
                %>
                <table width="600" border="0" style="padding:10px 0px 10px 0px;">
                    <tr>
                        <td>
                            Your session has expired. Please login again!<br/>
                            If you're not redirected to TCube Homepage in 4s, please click <a href="http://localhost:8080/portal/internal/TCubeHome">here</a>.
                        </td>
                    </tr>
                </table>
                <script type="text/javascript">
                    $(document).ready(function() {
                        setTimeout(window.location.replace("http://localhost:8080/portal/internal/TCubeHome"), 100000);
                    });
                </script>

                <%        } else if (result == Constants.STATUS_NOT_ALLOWED) {
                %>
                <table width="600" border="0" style="padding:10px 0px 10px 0px;">
                    <tr>
                        <td>
                            You're not allowed to make such action!<br/>
                            We have logged your attempt for further investigation.<br/>
                            If you're not redirected to TCube Homepage in 4s, please click <a href="http://localhost:8080/portal/internal/TCubeHome">here</a>.
                        </td>
                    </tr>
                </table>
                <!--<script type="text/javascript">
                    $(document).ready(function() {
                        setTimeout(window.location.replace("http://localhost:8080/portal/internal/"), 4000);
                    });
                </script>-->

                <%        } else {
                %>
                <table width="600" border="0" style="padding:10px 0px 10px 0px;">
                    <tr>
                        <td>
                            Please ensure you have entered the correct information.
                        </td>
                    </tr>
                </table>
                <%         }
                %>

                1 <%= request.getParameter("firstName")%><br/>
                2 <%= request.getParameter("lastName")%>   <br/>                
                3 <%= request.getParameter("NRIC")%><br/>
                4 <%= request.getParameter("sex")%><br/>
                5 <%= request.getParameter("countryCode")%><br/>
                6 <%= request.getParameter("phone")%><br/>
                7 <%= request.getParameter("email")%><br/>
                8 <%= request.getParameter("country")%><br/>
                9 <%= request.getParameter("city")%><br/>
                10 <%= request.getParameter("username")%><br/>
                11 <%= request.getParameter("password")%><br/>
                12 <%= request.getParameter("level")%><br/>
                13 <%= request.getParameter("theRole")%><br/>

                <!--End Login -->
            </div>
            <!-- End Content -->
            <!-- Footer -->
            <div class="grid_12 footer">
                <div id="footer"></div>
            </div>
            <!-- End Footer-->
        </div>
    </body>
</html>